using System;
using NUnit.Framework;

namespace SQLTests.Framework
{
	/// <summary>
	/// Summary description for AbstractTest.
	/// </summary>
	[TestFixture]
	public abstract class AbstractTest
	{
		#region constructor
		public AbstractTest()
		{
			_runTime = new TimeSpan();
			StartDocumenting();

		}
		#endregion
		#region run time

		private TimeSpan _runTime;
		private DateTime _startTest;

		public TimeSpan RunTime
		{
			get {return _runTime;}
		}

		#endregion
		#region logging

		public void StartDocumenting()
		{
            // EA0908: If this line is not added then Log4Net is not configured properly
            log4net.Config.XmlConfigurator.Configure();
            Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
			Console.WriteLine(this.GetType().Name);
			Console.WriteLine("Test [] has started");
			Console.WriteLine("===================");
			_startTest = DateTime.Now;
		}

		public void FinishDocumenting()
		{
			_runTime = new TimeSpan(DateTime.Now.Subtract(_startTest).Ticks);
			Console.WriteLine("Test time: " + _runTime.ToString());
		}

		#endregion
		#region set fixtures

		[TestFixtureSetUp]
		protected abstract void SetUpFixtures();

		#endregion


	}
}
